package com.tudouji.project.mt.http.request;

import com.google.gson.reflect.TypeToken;
import com.meituan.sdk.MeituanRequest;
import com.meituan.sdk.MeituanResponse;
import com.meituan.sdk.annotations.ApiMeta;
import com.meituan.sdk.internal.utils.JsonUtil;
import com.tudouji.project.mt.http.response.AuthResourcesResponse;
import lombok.Data;

import java.lang.reflect.Type;

/**
 * 查询授权资源ID列表
 */
@ApiMeta(
        path = "/rms/base/v1/auth/resources/get",
        businessId = 18,
        apiVersion = "",
        apiName = "",
        needAuth = true

)
@Data
public class AuthResourcesRequest implements MeituanRequest<AuthResourcesResponse> {

    //开发者id
    private Integer devId;

    //商家账号id
    private String bizAccId;

    //业务id
    private String bizId;

    @Override
    public MeituanResponse<AuthResourcesResponse> deserializeResponse(String response) {
        Type type = new TypeToken<MeituanResponse<AuthResourcesResponse>>(){}.getType();
        return JsonUtil.fromJson(response, type);
    }
    @Override
    public String serializeToJson() {
        return JsonUtil.toJson(this);
    }
}
